//
//  MyViewController.m
//  Hai
//
//  Created by 千金贷 on 16/2/23.
//  Copyright © 2016年 wangzijian. All rights reserved.
//

#import "SetupViewController.h"
#import "JTMaterialSwitch.h"
@interface SetupViewController ()

@end

@implementation SetupViewController
{
    JTMaterialSwitch *_ysSwitch;
    JTMaterialSwitch *_aaSwitch;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.navigationController.navigationBarHidden =NO;
    self.navigationItem.title = @"设置";
    [self switchView];
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewDidAppear:animated];
}

-(void)switchView{
    _aaSwitch = [[JTMaterialSwitch alloc] initWithSize:JTMaterialSwitchSizeNormal
                                                 style:JTMaterialSwitchStyleDefault
                                                 state:JTMaterialSwitchStateOn];
    _aaSwitch.center = CGPointMake(kScreenWidth-40, 25);
    [_aaSwitch addTarget:self action:@selector(stateChanged) forControlEvents:UIControlEventValueChanged];
    [self.topView addSubview:_aaSwitch];
    
    _ysSwitch = [[JTMaterialSwitch alloc] initWithSize:JTMaterialSwitchSizeNormal
                                                 style:JTMaterialSwitchStyleDefault
                                                 state:JTMaterialSwitchStateOn];
    _ysSwitch.center = CGPointMake(kScreenWidth-40, 75);
    [_ysSwitch addTarget:self action:@selector(stateChanged) forControlEvents:UIControlEventValueChanged];
    [self.topView addSubview:_ysSwitch];
}
- (void)stateChanged
{
    if(_aaSwitch.isOn == YES) {
    }
    else {
    }
}

@end
